
# 列表[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],要求你把列表里的每个值加1

a=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a = map(lambda x:x+1, a)
print(a)

for line in a:print(line)



a = [ x +1 for x in range(10) ]
print(
    a
)
# 列表生成式


s =  [i if i < 25 else i+100  for i in range(20,30)]
print(s)
# 高级用法三元运算





# a = (x +1 for x in range(10) )
# print( next(a) )
#
# for i in a:
#     print(i)
"""
[]列表生成式
()生成器
"""

